//
// Created by 谢哲 on 2021/5/13.
//

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> vdata(n, 0);
    for (auto &p: vdata) cin >> p;
    sort(vdata.begin(), vdata.end());

    priority_queue<int, vector<int>, greater<int>> old_queue;
    int ans = 99999999;

    int last_value = 0;
    for (int i=0; i<n; ++i) {
        priority_queue<int, vector<int>, greater<int>> new_queue;
        int j = i;
        for (; j<n && vdata[j]==vdata[i]; ++j) {
            if (!old_queue.empty()) {
                if (vdata[j] == last_value + 1) {
                    auto cur_val = old_queue.top() + 1;
                    old_queue.pop();
                    new_queue.push(cur_val);
                    continue;
                }
            }
            new_queue.push(1);
        }
        if (!old_queue.empty()) {
            ans = min(ans, old_queue.top());
            old_queue.pop();
        }
        last_value = vdata[i];
        i = j - 1;
        old_queue = new_queue;
    }
    if (!old_queue.empty()) {
        ans = min(ans, old_queue.top());
        old_queue.pop();
    }

    cout << ans;

    return 0;
}
